<template>
	<span>
		<a-button icon="upload" type="link" @click="openModal">导入</a-button>
		<import-data-modal ref="importDataModal" :key="dateTime" :visible="visible" @ok="confirm" @cancel="cancel"></import-data-modal>
	</span>
</template>

<script>
	import ImportDataModal from "./modal/ImportDataModal.vue"
	export default {
		components: {
			ImportDataModal
		},
		props: {
		},
		data() {
			return{
				visible: false,
				dateTime: 0
			}
		},
		methods: {
			confirm(){
				this.visible = false;
				this.$emit("ok");
			},
			cancel(){
				this.visible = false;
				this.$emit("cancel");
			},
			openModal(){
				this.dateTime = new Date().getTime();
				this.visible = true;
			}
		}
	}
</script>

<style>
	
</style>